<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>活动详情</title>
    <link rel="stylesheet" type="text/css" href="__CSS__api.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__aui.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__dropload.css"/>
    <style>
        html, body {
            width: 100%;
            height: 100%;
        }

        body {
            padding-bottom: 100px;
        }

        .flex-wrap {
            display: -webkit-box;
            display: box;
            display: -webkit-flex;
            display: flex;
        }

        .flex-con {
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            flex: 1;
        }

        .flex-vertical {
            -webkit-box-horizontal: vertical;
            -webkit-flex-flow: column;
            flex-flow: column;
        }

        .wei_huifu {
            width: 100%;
            height: 100%;
            position: fixed;
            z-index: 999;
        }

        .wei_huifu0 {
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.3);
        }

        .wei_huifu1 {
            width: 100%;
            min-height: 50px;
            background-color: #fff;
            position: absolute;
            bottom: 0;
        }

        .wei_huifu2 {
            width: 74px;
            background-color: #fff;
            color: #47A1FE;
            line-height: 50px;
            text-align: center;
            font-size: 16px;
            height: 50px;
            border: 0;
        }

        input[type='text'].wei_input {
            width: 100%;

            background-color: #f5f5f5;
            border-radius: 15px;
            outline: 0;
            margin-top: 10px;
        }

        .hidden {
            display: none;
        }
    </style>
    <style>
        html,
        body {
            /*color: #333;*/
            /*padding-bottom: 2.15rem;*/
        }

        /*header*/

        .aui-bar-nav .aui-iconfont {
            position: relative;
            font-family: "aui_iconfont" !important;
            font-size: 0.75rem;
            color: #E73C5C;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            height: 2.4rem;
        }

        .aui-bar-nav {
            background-color: transparent;
            position: fixed;
            top: 0;
        }

        .aui-icon-tu {
            height: 2.4rem;
            width: 70px;
            background: url('__IMG__main1_back1.png') no-repeat 0.75rem center;
            background-size: 40px 40px;
        }

        .aui-bar-nav .aui-title {
            font-size: 0.9rem;
            color: #333333;
            font-weight: 500;
        }

        .aui-icon-rightu {
            height: 2.4rem;
            width: 70px;
            background: url('__IMG__main1_share.png') no-repeat 0.75rem center;
            background-size: 40px 40px;
        }

        /*footer*/

        .footer {
            height: 3.5rem;
            background-color: #fff;
            padding: 0;
        }

        .like {
            width: 3.5rem;
        }

        .like_img {
            width: 1.2rem;
            height: 1.2rem;
            margin: 1.15rem auto;
        }

        .like_right {
            padding: 0.5rem 0;
            padding-right: 0.75rem;
        }

        .like_txt {
            width: 100%;
            height: 100%;
            color: #fff;
            font-weight: 500;
            text-align: center;
            line-height: 2.5rem;
            font-size: 0.8rem;
            background-color: #E73C5C;
            border-radius: 0.25rem;
        }

        .like_txt1 {
            width: 100%;
            height: 100%;
            color: #fff;
            font-weight: 500;
            text-align: center;
            line-height: 2.5rem;
            font-size: 0.8rem;
            background-color: #E73C5C;
            border-radius: 0.25rem;
        }

        /*content*/

        .header_img {
            width: 100%;
            height: 18rem;
        }

        .header_img img {
            width: 100%;
            height: 18rem;
        }

        .header_title {
            color: #333;
            font-weight: 500;
            font-size: 0.75rem;
            padding: 0.5rem 0.75rem 0;
        }

        .jiangzuo {
            border-radius: 0.2rem;
            margin-top: 0.5rem;
            color: #ccc;
            font-size: 20px;
            padding: 0.2rem 0.5rem;
            display: inline-block;
            border: 1px solid #E6E6E6;
            font-weight: normal;
            margin-left: 0.75rem;
            transform-origin: top left;
            -webkit-transform-origin: top left;
            -ms-transform-origin: top left;
            -moz-transform-origin: top left;
            -o-transform-origin: top left;
            transform: rotate(7deg);
            -ms-transform: scale(0.5);
            /* IE 9 */
            -moz-transform: scale(0.5);
            /* Firefox */
            -webkit-transform: scale(0.5);
            -o-transform: scale(0.5);
        }

        .title_jiangzuo {
            background-color: #fff;
            height: 100px;
        }

        .arrow {
            width: 1.1rem;
            height: 2.5rem;
            background: url('__IMG__main1_right.png') no-repeat center center;
            background-size: 22px 22px;
        }

        .outer_all {
            margin-top: 0.5rem;
            background-color: #fff;
            padding: 0 0.75rem;
            font-size: 0.75rem;
        }

        .outer {
            height: 2.5rem;
            line-height: 2.55rem;
        }

        .tubiao {
            width: 22px;
            height: 100%;
            display: flex;
            align-items: center;
            margin-right: 0.5rem;
        }

        .tubiao img {
            width: 22px;
            height: 22px;
            display: inline-block;
        }

        .outer_all .outer:nth-child(2) {
            height: auto;
            line-height: normal;
        }

        .address {
            padding: 17px 0 15px;
        }

        .address_img {
            width: 22px;
            background: url('__IMG__main1_address.png') no-repeat center center;
            background-size: 22px 22px;
            margin-right: 0.5rem;
        }

        .rich_text {
            margin-top: 0.5rem;
            padding: 0.75rem;
            background-color: #fff;
        }

        /*评论*/

        .comment {
            margin-top: 0.5rem;
            padding: 0.75rem;
            font-size: 0.7rem;
            background-color: #fff;
        }

        .comment_title {
            margin-bottom: 0.75rem;
        }

        .user_img {
            width: 2.5rem;
        }

        .user_img img {
            width: 1.75rem;
            height: 1.75rem;
        }

        .user_name {
            font-size: 0.65rem;
            height: 1.75rem;
            line-height: 1.75rem;
        }

        .comment_delete {
            float: right;
            width: 2.5rem;
            height: 1.75rem;
            display: inline-block;
            background: url('__IMG__main1_delete.png') no-repeat right center;
            background-size: 17px 17px;
        }

        /*.comment_desc,*/
        .comment_imgs, .comment_imgs1, .comment_imgs2 {
            margin-top: 0.5rem;
            /*padding-bottom: 0.5rem;*/
        }

        .comment_imgs img, .comment_imgs1 img, .comment_imgs2 img {
            float: left;
            width: 100px;
            height: 100px;
            margin-right: 0.5rem;
            border-radius: 0.25rem;
        }

        .comment_imgs2 img {
            width: 8.5rem;
            height: 8.5rem;
        }

        .comment_imgs img:last-child, .comment_imgs1 img:last-child {
            float: left;
            margin-right: 0;
        }

        .comment_txt {
            background-color: #f5f5f5;
            padding: 0.75rem 0.5rem 0.75rem 0.75rem;
            margin-top: 0.5rem;
            /*margin-bottom: 0.3rem;*/
        }

        .red_delete {
            float: right;
            color: #E73C5C;
            font-size: 0.6rem;
            padding: 2px 0 0 10px;
        }

        .comment_two {
            margin-top: 0.3rem;
        }

        .comment_three {
            margin-top: 0.5rem;
            color: #47A1FE;
        }

        .edit {
            width: 2.8rem;
            height: 2.8rem;
            border-radius: 50%;
            margin: 0.75rem auto;
        }

        .comment_footer {
            height: 30px;
            line-height: 30px;
            color: #b3b3b3;
            font-size: 0.8rem;
            margin-top: 0.25rem;
        }

        .comment_time {
            font-size: 0.6rem;
        }

        .zan {
            width: 22px;
            height: 30px;
            display: inline-block;
            background: url('__IMG__main1_nozan.png') no-repeat center center;
            background-size: 13px 13px;
            vertical-align: bottom;
        }

        .zan1 {
            width: 22px;
            height: 30px;
            display: inline-block;
            background: url('__IMG__main1_zan.png') no-repeat center center;
            background-size: 13px 13px;
            vertical-align: bottom;
        }

        .comment_total {
            width: 22px;
            height: 30px;
            display: inline-block;
            background: url('__IMG__main1_news.png') no-repeat center center;
            background-size: 13px 13px;
            vertical-align: bottom;
        }

        .float_right {
            display: inline-block;
            width: auto;
            height: 30px;
            line-height: 30px;
            float: right;
        }

        .comment_all {
            margin-right: 1rem;
        }
    </style>
    <style>
        /*献爱心弹框*/

        .tan1 {
            position: fixed;
            height: 100%;
            width: 100%;
            top: 0;
            left: 0;
            z-index: 666;
            background-color: rgba(0, 0, 0, 0.2);
        }

        .four {
            padding-top: 20px;
            background-color: #FFFFFF;
        }

        .share_tit {
            text-align: center;
            font-size: 15px;
            color: #333333;
            padding-top: 0.75rem;
            padding-bottom: 1.05rem;
        }

        .four_11 {
            width: 2.25rem;
            height: 2.25rem;
            margin: 0 auto;
        }

        .four_11 img {
            width: 100%;
            height: 100%;
        }

        .four_name {
            font-size: 13px;
            color: #999999;
            padding-top: 0.5rem;
            text-align: center;
        }

        .cancel {
            height: 2.5rem;
            line-height: 2.5rem;
            font-size: 16px;
            color: #333333;
            text-align: center;
            background-color: #FFFFFF;
        }

        /*捐赠弹框*/

        .tan2 {
            position: fixed;
            height: 100%;
            width: 100%;
            top: 0;
            left: 0;
            z-index: 999;
            background-color: rgba(0, 0, 0, 0.2);
        }

        .all {
            background-color: #FFFFFF;
            padding-left: 0.75rem;
            padding-right: 0.75rem;
        }

        .tit {
            padding-top: 1.275rem;
            padding-bottom: 1.025rem;
            color: #333333;
            font-size: 0.75rem;
        }

        .choose {
            width: 100%;
        }

        .label {
            position: relative;
            display: inline-block;
            width: 27%;
            height: 1.7rem;
            line-height: 1.7rem;
            text-align: center;
            border-radius: 0.25rem;
            margin-bottom: 4.5px;
            color: #E73C5C;
            font-size: 0.75rem;
        }

        .label::before {
            content: '';
            height: 200%;
            width: 199.5%;
            position: absolute;
            top: -55%;
            left: -52%;
            border-radius: 0.5rem;
            border: 1px solid #E73C5C;
            transform: scale(0.5);
            -webkit-transform: scale(0.5);
            -ms-transform: scale(0.5);
            -moz-transform: scale(0.5);
            -o-transform: scale(0.5);
            font-size: 1.5rem;
        }

        .label_choose {
            color: #FFFFFF;
            font-size: 0.75rem;
            background-color: #E73C5C;
        }

        .label:nth-child(3n+2) {
            margin-right: 8%;
            margin-left: 8%;
        }

        .shuru {
            position: relative;
        }

        input[type="text"] {
            position: absolute;
            top: 0;
            left: 0;
            height: 3.3rem;
            width: 200%;
            line-height: auto;
            background-color: #fff;
            color: #333;
            font-size: 28px;
            border: 1px solid #E6E6E6;
            border-radius: 12px;
            transform: scale(0.5);
            -webkit-transform: scale(0.5);
            -ms-transform: scale(0.5);
            -moz-transform: scale(0.5);
            -o-transform: scale(0.5);
            transform-origin: left top;
        }

        input::-webkit-input-placeholder {
            color: #CCCCCC;
            font-size: 28px;
        }

        .donate {
            height: 1.65rem;
            line-height: 1.65rem;
            text-align: center;
            border-radius: 0.25rem;
            color: #FFFFFF;
            font-size: 0.75rem;
            background-color: #E73C5C;
            margin-left: 0.55rem;
            padding-left: 0.65rem;
            padding-right: 0.65rem;
        }

        .btn {
            margin-bottom: 1.475rem;
        }

        textarea {
            -webkit-appearance: none;
            background: white;
        }
    </style>
</head>

<body>
<div class="flex-vertical wei_huifu hidden" id="wei_huifu">
    <div class="flex-con wei_huifu0" onclick="wei_hui2()"></div>
    <input type="hidden" name="my_answer_id" value="">
    <div class="wei_huifu1">
        <div class="flex-wrap">
            <div class="flex-con" style="padding-left:15px;">
                <textarea name="huifucontent" id="" placeholder="输入回复内容"
                          cols="20" rows="2" initAttrH="40px" class="wei_input"></textarea>
            </div>
            <button class="wei_huifu2" onclick="wei_hui1()">回复</button>
        </div>
    </div>
</div>
<header class="aui-bar aui-bar-nav" style="padding-top:25px;" id="header">
    <input type="hidden" name="id" value="{$id}">
    <a class="aui-pull-left" tapmode="active" onclick="history.go(-1)">
        <span class="aui-iconfont aui-icon-tu"> </span>
    </a>
    <div class="aui-title"></div>
    <a class="aui-pull-right">
        <span class="aui-iconfont aui-icon-rightu" tapmode="active" onclick="right()"></span>
    </a>
</header>
<div class="header_img">
    <img src="{$list.activity_img}" alt="">
</div>
<div class="title_jiangzuo">
    <div class="header_title aui-ellipsis-2">
        {$list.activity_name}
    </div>
    <div class="jiangzuo">{$list.name}</div>
</div>

<div class="outer_all">
    <div class="outer flex-wrap underLine2" onclick="fnSponsor(this)" idd="{$list.activity_mechanism_id}">
        <div class="tubiao"><img src="__IMG__main1_sponsor.png" alt=""></div>
        <div class="" tapmode="active">{$list.mechanism_name}</div>
        <div class="flex-con"></div>
        <div class="arrow"></div>
    </div>
    <div class="outer flex-wrap underLine2">
        <div class="address_img"></div>
        <div class="flex-con address">
            <div class="aui-ellipsis-2 ">
                {$list.activity_address}
            </div>
        </div>
    </div>
    <div class="outer flex-wrap">
        <div class="tubiao"><img src="__IMG__main1_time.png" alt=""></div>
        <div class="">{$list.activity_start_time}至{$list.activity_end_time}</div>
        <div class="flex-con"></div>
    </div>
</div>
<!-- 富文本 -->
<div class="rich_text">{$list.activity_content}</div>
<!-- 富文本 -->
{if $list.activity_status==3}
<div class="comment">
    <div class="comment_title">评论({$list.count})</div>
    <div class="upOrDown">
        <div class="upOrDown_data">
            {if count($list['first_answer'])>0}
            <!-- 评论-->
            {volist name="list['first_answer']" id="vo"}
            <div class="flex-wrap">
                <div class="user_img"><img src="{$vo.user_image}" alt=""></div>
                <div class="flex-con">
                    <div class="user_name">{$vo.user_username}
                        {if $vo['zj_fb'] == 1}
                        <span class="comment_delete" onclick="zj_fb(this)" idd="{$vo.answer_id}"></span>
                        {/if}
                    </div>
                    <!-- main1_pinglun.png -->
                    <div class="comment_desc aui-ellipsis-2">{$vo.answer_content}</div>
                    <!-- 三张图 -->
                    <div class="comment_imgs after">
                        <!-- 评论图片-->
                        {volist name="vo['answer_img']" id="vv"}
                        <img src="{$vv}" alt="">
                        {/volist}
                        <!-- 评论图片结束-->
                    </div>
                    <!--评论回复开始-->
                    {if count($vo['answer'])>0}
                    <div class="comment_txt">

                        {volist name="vo['answer']" id="vk"}
                        <div class="comment_one">{$vk.user_username}：{$vk.reply_content}
                            {if $user_id == $vk.reply_user_id}
                            <span class="red_delete" onclick="clearDe(this)" idd="{$vk.reply_id}">删除</span>
                            {/if}
                        </div>

                        {/volist}
                        {if $vo.count_answer >2}
                        <div class="comment_three" onclick="fnComment(this)" idd="{$vo.answer_id}" tapmode='acdtive'>
                            查看全部回复>
                        </div>
                        {/if}
                    </div>

                    {/if}
                    <!--评论的回复结束-->
                    <div class="comment_footer">
                        <span class="comment_time">{$vo.answer_time}</span>
                        <!--点赞数量开始-->
                        <span class="float_right" onclick="fnZan(this)" idd="{$vo.answer_id}" dz="{$vo.dz}">
                                                {if $vo.dz==1}
                                                <span class="zan1" id="dianzan"></span>
                                                {else /}
                                                <span class="zan" id="dianzan"></span>
                                                {/if}
                                                <span id="zan_num">{$vo.answer_dz}</span>
                                            </span>
                        <!--点赞结束-->
                        <!--评论数量开始-->
                        <span class="float_right comment_all" onclick="wei_hui(this)" idd="{$vo.answer_id}"
                              tapmode='active'>
                                                <span class="comment_total"></span>
                                            {$vo.count_answer}
                                            </span>
                        <!--评论数量结束-->
                    </div>
                </div>
            </div>
            {/volist}
            <!-- 评论结束-->
            {/if}
        </div>
    </div>
</div>

{/if}
{if $list.activity_status==3}
<img tapmode="active" onclick="fnEdit(this)" idd="{$list.id}" style="" src="__IMG__main1_edit.png" alt="" class="edit">
{/if}
<div style="height:70px"></div>


<footer class="footer flex-wrap topLine1">
    {if $list.collection==1}
    <div class="like" onclick="likesc(this)" idd="{$list.id}">
        <img src="__IMG__main1_like.png" alt="" class="like_img">
    </div>
    {else /}
    <div class="like" onclick="likesc(this)" idd="{$list.id}">
        <img src="__IMG__main1_unlike.png" alt="" class="like_img">
    </div>
    {/if}
    <!--<div class="flex-con like_right">-->
    <!--&lt;!&ndash; 不可点击时背景色f39dad &ndash;&gt;-->
    <!--<div class="flex-con like_right hidden" id='idd4'>-->
    <!--<div class="like_txt" onclick="fnEnroll(this)" idd="{$list.id}" tapmode='active'>我要报名</div>-->
    <!--&lt;!&ndash; 不可点击时背景色f39dad &ndash;&gt;-->
    <!--</div>-->

    <!--<div class="flex-con like_right hidden" id='idd1'>-->
    <!--<div class="like_txt" style="background-color:#f39dad;">已报名</div>-->
    <!--&lt;!&ndash; 不可点击时背景色f39dad &ndash;&gt;-->
    <!--</div>-->
    <!--<div class="flex-con like_right hidden" id='idd2'>-->
    <!--<div class="like_txt" onclick="fnSign(this)" idd="{$list.id}" tapmode='active'>签到</div>-->
    <!--</div>-->
    <!--<div class="flex-con like_right hidden" id='idd3'>-->
    <!--<div class="like_txt" onclick="fnSign(this)" idd="{$list.id}" tapmode='active'>签退</div>-->
    <!--</div>-->
    <!--<div class="flex-con like_right hidden" id='idd5'>-->
    <!--<div class="like_txt" style="background-color:#f39dad;" id='idd5_time'></div>-->
    <!--</div>-->
    <!--</div>-->
    <!--  首先没有报名的活动可以报名-->
    <div class="flex-con like_right hidden" id='idd4'>
        <div class="like_txt" onclick="fnEnroll(this)" idd="{$list.id}" tapmode='active'>我要报名</div>
        <!-- 不可点击时背景色f39dad -->
    </div>

    <div class="flex-con like_right hidden" id='idd1'>
        <div class="like_txt" style="background-color:#f39dad;">已报名</div>
        <!-- 不可点击时背景色f39dad -->
    </div>
    <div class="flex-con like_right hidden" id='idd2'>
        <div class="like_txt" onclick="fnSign(this)" idd="{$list.id}" tapmode='active'>签到</div>
    </div>
    <div class="flex-con like_right hidden" id='idd3'>
        <div class="like_txt" onclick="fnSign(this)" idd="{$list.id}" tapmode='active'>签退</div>
    </div>
    <div class="flex-con like_right hidden" id='idd5'>
        <div class="like_txt" style="background-color:#f39dad;">距开始 <span id='idd5_time'></span></div>
    </div>
    <div class="flex-con like_right hidden" id='idd6'>
        <div class="like_txt" style="background-color:#f39dad;">活动已结束</div>
        <!-- 不可点击时背景色f39dad -->
    </div>
    <!-- 献爱心弹框 -->
    <div class="flex-wrap flex-vertical tan1 hidden">
        <div class="flex-con"></div>
        <div class="four">
            {if $list.collection==1}
            <div class="aui-col-xs-4" onclick="likesc(this)" idd="{$list.id}">
                <img src="__IMG__share5.png" class="four_11"/>
                <div class="four_name aui-ellipsis-2">
                    <span id='shoucanggggName'>取消收藏</span>
                </div>
            </div>
            {else /}
            <div class="aui-col-xs-4" onclick="likesc(this)" idd="{$list.id}">
                <img src="__IMG__share5.png" class="four_11"/>
                <div class="four_name aui-ellipsis-2">
                    <span id='shoucanggggName'>收藏</span>
                </div>
            </div>
            {/if}
            <div class="aui-col-xs-4" onclick="xax()">
                <img src="__IMG__share6.png" class="four_11"/>
                <div class="four_name aui-ellipsis-2">
                    献爱心
                </div>
            </div>
            {if $list['activity_status']==2}
            {if $list['already_sign']==1}
            <div class="aui-col-xs-4" onclick="qxbom(this)" idd="{$list.id}">
                <img src="__IMG__share7.png" class="four_11"/>
                <div class="four_name aui-ellipsis-2">
                    取消报名
                </div>
            </div>
            {/if}
            {/if}
        </div>
        <div class="cancel topLine2" onclick="quxiao()">取消</div>
    </div>
    <!--捐赠弹框-->
    <div class="flex-wrap flex-vertical tan2 hidden">
        <div class="flex-con"></div>
        <div class="all">
            <div class="tit">请选择捐款金额</div>
            <div class="choose" id="one">
                <div class="label">20元</div>
                <div class="label">50元</div>
                <div class="label">100元</div>
            </div>
            <div class="tit">其他金额</div>
            <div class="flex-wrap btn">
                <div class="flex-con shuru">
                    <input type="text" placeholder="最大1000元" id="money-input" maxlength=6/>
                </div>
                <div class="donate" tapmode="active" onclick="fnPay()">捐赠</div>
            </div>
        </div>
    </div>
    <input type="hidden" name="time" value="{$list.activity_start_times}">
    <input type="hidden" name="time_data" value="{$list.time}">
    <input type="hidden" name="activity_status" value="{$list.activity_status}">
    <input type="hidden" name="already_sign" value="{$list.already_sign}">
</footer>
</body>
<script type="text/javascript" src="__JS__tt.js"></script>
<script type="text/javascript" src="__JS__jquery.min.js"></script>
<script type="text/javascript" src="__JS__dropload.min.js"></script>
<script type="text/javascript" src="__JS__layer_mobile/layer.js"></script>
<script type="text/javascript" src="__JS__api.js"></script>
<script>
    window.onload = function () {
        $.fn.extend({
            txtaAutoHeight: function () {
                return this.each(function () {
                    var $this = $(this);
                    if (!$this.attr('initattrh')) {
                        $this.attr('initattrh', $this.outerHeight());
                    }
                    setAutoHeight(this).on('input', function () {
                        setAutoHeight(this);
                    });
                });
                function setAutoHeight(elem) {
                    var $obj = $(elem);
                    return $obj.css({height: $obj.attr('initattrh'), 'overflow-y': 'hidden'}).height(elem.scrollHeight+10);
                }
            }
        });
        $("textarea").txtaAutoHeight();
    }
    //显示
    function wei_hui(el) {
        var idd = $api.attr(el, 'idd');
        document.getElementById('wei_huifu').className = 'flex-vertical wei_huifu';
        $('input[name="my_answer_id"]').val(idd);

        $("body").css("overflow-y", 'hidden');
    }
    //隐藏
    function wei_hui1() {
        var content = $.trim($('textarea[name="huifucontent"]').val());
        var id = $('input[name="my_answer_id"]').val();
        if (content.length > 200) {
            layer.open({
                content: "回复不能超过200个字节",
                skin: 'msg'
                , time: 3 //2秒后自动关闭
            });
            return false;
        }
        if (content.length <= 0) {
            layer.open({
                content: "回复不能为空",
                skin: 'msg'
                , time: 3 //2秒后自动关闭
            });
            return false;
        }
        $.ajax({
            url: '{:url("First/Reply")}',
            data: {answer_id: id, content: content},
            type: 'POST',
            dataType: 'JSON',
            success: function (data) {
                if (data.status == 200) {
                    document.getElementById('wei_huifu').className = 'flex-vertical wei_huifu hidden';
                    window.location.reload();

                } else if (data.status == 'E137') {
                    layer.open({
                        content: data.msg,
                        skin: 'msg'
                        , time: 3 //2秒后自动关闭
                    });
                    document.getElementById('wei_huifu').className = 'flex-vertical wei_huifu hidden';

                    window.location.reload();
                } else if (data.status == 'E137') {
                    layer.open({
                        content: data.msg,
                        skin: 'msg'
                        , time: 3 //2秒后自动关闭
                    });
                    document.getElementById('wei_huifu').className = 'flex-vertical wei_huifu hidden';

                    window.location.reload();
                }
            }
        })
    }
    //隐藏
    function wei_hui2() {
        document.getElementById('wei_huifu').className = 'flex-vertical wei_huifu hidden';
    }
</script>
<script>
    getActivityStatus = $('input[name="activity_status"]').val();
    getAlreadySign = $('input[name="already_sign"]').val();
    activity_start_time = $('input[name="activity_start_times"]').val();
    time = $('input[name="time"]').val();
    //    if(getActivityStatus!=4){
    //        if(getAlreadySign == 4){
    //            $api.removeCls($api.byId('idd4'), 'hidden');
    //        }else if (getAlreadySign == 1) {
    //            $api.removeCls($api.byId('idd1'), 'hidden');
    //        }else if(getAlreadySign==2){
    //            $api.removeCls($api.byId('idd2'), 'hidden');
    //        }else if(getAlreadySign==3){
    //            $api.removeCls($api.byId('idd3'), 'hidden');
    //        }else if(getAlreadySign==5){
    //            $api.removeCls($api.byId('idd5'), 'hidden');
    //
    //            lastTime=changeTimeeeeToNumber(activity_start_time);
    //            nowTime=Number(time)*1000;
    //            timeCha=Number(lastTime)-Number(nowTime)-7200000;
    //
    //            t1 = setInterval(function() {
    //                getTime=timeCha-1000;
    //                $api.byId('idd5_time').innerHTML=formatDuring(getTime);
    //                timeCha=getTime;
    //                if(timeCha<0){
    //                    clearInterval(t1);
    //                    $api.addCls($api.byId('idd5'), 'hidden');
    //                    $api.removeCls($api.byId('idd2'), 'hidden');
    //                }
    //            }, 1000);
    //
    //        }
    //    }
    if (getActivityStatus != '4') {
        if (getAlreadySign == '4') {
            $api.removeCls($api.byId('idd4'), 'hidden');
        } else if (getAlreadySign == '1') {
            $api.removeCls($api.byId('idd1'), 'hidden');
        } else if (getAlreadySign == '2') {
            $api.removeCls($api.byId('idd2'), 'hidden');
        } else if (getAlreadySign == '3') {
            $api.removeCls($api.byId('idd3'), 'hidden');
        } else if (getAlreadySign == '5') {
            $api.removeCls($api.byId('idd5'), 'hidden');
            lastTime = changeTimeeeeToNumber(successData.data.activity_start_time);
            nowTime = Number(successData.data.time) * 1000;
            timeCha = Number(lastTime) - Number(nowTime) - 7200000;
            t1 = setInterval(function () {
                getTime = timeCha - 1000;
                $api.byId('idd5_time').innerHTML = formatDuring(getTime);
                timeCha = getTime;
                if (timeCha < 0) {
                    clearInterval(t1);
                    $api.addCls($api.byId('idd5'), 'hidden');
                    $api.removeCls($api.byId('idd2'), 'hidden');
                }
            }, 1000);


        }

    } else {
        $api.removeCls($api.byId('idd6'), 'hidden');
    }
</script>
<script type="text/javascript">
    //删除评论回复
    function clearDe(el) {
        var idd = $api.attr(el, 'idd');
        $.ajax({
            url: '{:url("First/delete")}',
            data: {answer_id: idd, type: 2},
            type: 'POST',
            dataType: 'JSON',
            success: function (data) {
                if (data.status == 200) {
                    layer.open({
                        content: '操作成功'
                        , skin: 'msg'
                        , time: 3 //2秒后自动关闭
                    });
                    window.location.reload();
                } else if (data.status == 'E001') {
                    layer.open({
                        content: '操作失败'
                        , skin: 'msg'
                        , time: 3 //2秒后自动关闭
                    });
                    window.location.reload();
                }
            }
        })
    }
    //删除评论
    function zj_fb(el) {
        var idd = $api.attr(el, 'idd');
        $.ajax({
            url: '{:url("First/delete")}',
            data: {answer_id: idd, type: 1},
            type: 'POST',
            dataType: 'JSON',
            success: function (data) {
                if (data.status == 200) {
                    layer.open({
                        content: '操作成功'
                        , skin: 'msg'
                        , time: 3 //2秒后自动关闭
                    });
                    window.location.reload();
                } else if (data.status == 'E001') {
                    layer.open({
                        content: '操作失败'
                        , skin: 'msg'
                        , time: 3 //2秒后自动关闭
                    });
                    window.location.reload();
                }
            }
        })
    }
    //活动评论点赞
    function fnZan(el) {
        var idd = $api.attr(el, 'idd');
        $.ajax({
            url: '{:url("First/dzactivity")}',
            data: {answer_id: idd, type: 1},
            type: 'POST',
            dataType: 'JSON',
            success: function (data) {
                alert(data.msg);
                alert(data.type);
                alert(data.data_id);
                alert(data.user_id);
                if (data.status == 200) {
                    if ($api.attr(el, 'dz') == '2') {
                        $api.dom(el, '#zan_num').innerHTML = parseInt($api.dom(el, '#zan_num').innerHTML) + 1;

                        $api.dom(el, '#dianzan').style.backgroundImage = "url('" + "__IMG__main1_zan.png" + " ') ";

                        $api.attr(el, 'dz', '1');
                    } else {
                        $api.dom(el, '#zan_num').innerHTML = parseInt($api.dom(el, '#zan_num').innerHTML) - 1;

                        $api.dom(el, '#dianzan').style.backgroundImage = "url('" + "__IMG__main1_nozan.png" + " ') ";

                        $api.attr(el, 'dz', '2');
                    }

                } else if (data.status == 'E001') {
                    layer.open({
                        content: '操作失败'
                        , skin: 'msg'
                        , time: 3 //2秒后自动关闭
                    });
//                    window.location.reload();
                }
            }
        })
    }
    //收藏，取消收藏
    function likesc(el) {
        var idd = $api.attr(el, 'idd');
        $.ajax({
            url: '{:url("First/sc")}',
            data: {id: idd},
            type: 'POST',
            dataType: 'JSON',
            success: function (data) {

                if (data.status == 200) {
                    layer.open({
                        content: '操作成功'
                        , skin: 'msg'
                        , time: 3 //2秒后自动关闭
                    });
//                    if(data.data.collect==2){
//                        $( ".like_img" ).attr( "src" ,'__IMG__main1_unlike.png');
//                    }else if(data.data.collect==1){
//                        $( ".like_img" ).attr( "src" ,'__IMG__main1_like.png');
//                    }
//                    $(".tan2").addClass('hidden');
//                    $(".tan1").addClass('hidden');
                    window.location.reload();

                } else if (data.status == 'E001') {
                    layer.open({
                        content: '操作失败'
                        , skin: 'msg'
                        , time: 3 //2秒后自动关闭
                    });
                    window.location.reload();
                }
            }
        })
    }

    function quxiao() {
        $(".tan2").addClass('hidden');
        $(".tan1").addClass('hidden');

    }
    //右边点击事件
    function right() {
        $(".tan1").removeClass('hidden');
    }
    //献爱心
    function xax() {
        $(".tan2").removeClass('hidden');
    }
    function qxbom(el) {
//        var activity_id = $('input[name="id"]').val();

        var idd = $api.attr(el, 'idd');
        $.ajax({
            url: '{:url("First/cancelSign")}',
            data: {id: idd},
            type: 'POST',
            dataType: 'JSON',
            success: function (data) {
                if (data.status == 200) {
                    layer.open({
                        content: "取消报名成功",
                        skin: 'msg'
                        , time: 3 //2秒后自动关闭
                    });
                    setTimeout(function () {
                        window.location.reload();

                    },1500)
                } else if (data.status == 'E123') {
                    layer.open({
                        content: data.msg,
                        skin: 'msg'
                        , time: 3 //2秒后自动关闭
                    });
                    window.location.reload();
                } else if (data.status == 'E134') {
                    layer.open({
                        content: data.msg,
                        skin: 'msg'
                        , time: 3 //2秒后自动关闭
                    });
                    window.location.reload();
                }
            }
        })
    }
    // 查看全部回复
    function fnComment(el) {
        var idd = $api.attr(el, 'idd');
        location.href = '{:url("First/moreanswer")}?id=' + idd;
    }

    // 去评论
    function fnEdit(el) {
        var idd = $api.attr(el, 'idd');
        location.href = '{:url("First/activitylist")}?id=' + idd;
    }

    // 进行中-去签到
    function fnSign(el) {
        var idd = $api.attr(el, 'idd');
        location.href = '{:url("First/sign")}?id=' + idd;
    }

    // 报名中-去报名
    function fnEnroll(el) {
        var idd = $api.attr(el, 'idd');
        $.ajax({
            url: '{:url("First/bmpd")}',
            data: {activity: idd},
            type: 'POST',
            dataType: 'JSON',
            success: function (data) {
                if (data.status == 200) {
                    location.href = '{:url("First/bm")}?activity=' + idd;
                } else {
                    layer.open({
                        content: data.msg,
                        skin: 'msg'
                        , time: 5 //2秒后自动关闭
                    });
                }
            }
        })
    }
    // 主办方
    function fnSponsor(el) {
        var idd = $api.attr(el, 'idd');
        location.href = '{:url("Mechanism/mechanismDetail")}?mechanism_id=' + idd;
    }
</script>
<script>
    var page = 1;
    /**
     * 上拉加载，下拉刷新
     */
    var dropload = $('.upOrDown').dropload({
        scrollArea: window,
        autoLoad: true,
//        domUp : {
//            domClass   : 'dropload-up',
//            domRefresh : '<div class="dropload-refresh">↓下拉刷新-自定义内容</div>',
//            domUpdate  : '<div class="dropload-update">↑释放更新-自定义内容</div>',
//            domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中-自定义内容...</div>'
//        },
//        domDown : {
//            domClass   : 'dropload-down',
//            domRefresh : '<div class="dropload-refresh">刷新</div>',
//            domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
//            domNoData  : '<div class="dropload-noData">无数据</div>'
//        },
        loadDownFn: function (me) {
            var keyword = $('input[name="id"]').val();
            page++;
            $.ajax({
                url: '{:url("First/ajaxactivitypl")}',
                data: 'page=' + page + '&activity_id=' + keyword,//
                type: 'POST',
                dataType: 'json',
                success: function (data) {
                    var arrLen = data.msg.length;
                    if (arrLen <= 0) {

                        me.lock();
//                         无数据
                        me.noData(true);
                        // 每次数据加载完，必须重置
                        me.resetload();
                    } else {

                        var dataList = data.msg;
                        $.each(dataList, function (key, v) {
                            var _html = '';
                            _html += '<div class="flex-wrap">';
                            _html += '<div class="user_img"><img src="' + v.user_image + '"></div>';
                            _html += '<div class="flex-con">';
                            _html += '<div class="user_name">' + v.user_username;
                            if (v.zj_fb == 1) {
                                _html += '<span class="comment_delete zj_fb"  id="' + v.answer_id + '"></span>';
                                _html += '</div>';
                            }
                            <!-- main1_pinglun.png -->
                            _html += '<div class="comment_desc aui-ellipsis-2">' + v.answer_content + '</div>';
                            _html += '<div class="comment_imgs after">';
                            <!-- 评论图片-->
                            $.each(v.img, function (kk, vo) {
                                _html += '<img src="' + vo + '" alt="">';
                            })
                            _html += '</div>';
                            if (v.answer.length > 0) {
                                _html += '<div class="comment_txt">';

                                $.each(v.answer, function (ky, vk) {
                                    _html += '<div class="comment_one">' + vk.user_username + '：' + vk.reply_content;
                                    if (vk.is_delete == 1) {
                                        _html += '<span class="red_delete clearDe"  idd="' + vk.reply_id + '">删除</span>';
                                    }
                                    _html += '</div>';
                                })
                                if (v.count > 2) {
                                    _html += '<div class="comment_three" onclick="fnComment(this)" idd="' + v.answer_id + '" tapmode="acdtive">';
                                    _html += '查看全部回复>';
                                    _html += '</div>';
                                }
                                _html += '</div>';
                            }

                            <!--评论的回复结束-->
                            _html += '<div class="comment_footer">';
                            _html += '<span class="comment_time">' + v.answer_time + '</span>';
                            <!--点赞数量开始-->
                            _html += '<span class="float_right" onclick="fnZan(this)" dz="' + v.dz + '"  idd="' + v.answer_id + '" tapmode="active">';
                            if (v.dz == 1) {
                                _html += '<span class="zan1" id="dianzan"></span>';
                            } else {
                                _html += '<span class="zan" id="dianzan"></span>';
                            }

                            _html += '<span id="zan_num">' + v.answer_dz + '</span></span>';
                            <!--点赞结束-->
                            <!--评论数量开始-->
                            _html += '<span class="float_right comment_all" onclick="wei_hui(this)" idd="' + v.answer_id + '" tapmode="active">';
                            _html += '<span class="comment_total"></span>' + v.count;
                            _html += '</span>';
                            <!--评论数量结束-->
                            _html += '</div></div> </div>';
                            $(".upOrDown_data").append(_html);
                        });
                        // 每次数据加载完，必须重置
                        me.resetload();
                    }
                    $('.clearDe').click(function () {
                        var id = $(this).attr('id');
                        $.ajax({
                            url: '{:url("First/delete")}',
                            data: {answer_id: id, type: 2},
                            type: 'POST',
                            dataType: 'JSON',
                            success: function (data) {
                                if (data.status == 200) {
                                    layer.open({
                                        content: '操作成功'
                                        , skin: 'msg'
                                        , time: 3 //2秒后自动关闭
                                    });
                                    window.location.reload();
                                } else if (data.status == 'E001') {
                                    layer.open({
                                        content: '操作失败'
                                        , skin: 'msg'
                                        , time: 3 //2秒后自动关闭
                                    });
                                    window.location.reload();
                                }
                            }
                        })
                    });
                    $('.zj_fb').click(function () {
                        var id = $(this).attr('id');
                        $.ajax({
                            url: '{:url("First/delete")}',
                            data: {answer_id: idd, type: 1},
                            type: 'POST',
                            dataType: 'JSON',
                            success: function (data) {
                                if (data.status == 200) {
                                    layer.open({
                                        content: '操作成功'
                                        , skin: 'msg'
                                        , time: 3 //2秒后自动关闭
                                    });
                                    window.location.reload();
                                } else if (data.status == 'E001') {
                                    layer.open({
                                        content: '操作失败'
                                        , skin: 'msg'
                                        , time: 3 //2秒后自动关闭
                                    });
                                    window.location.reload();
                                }
                            }
                        })

                    });
                },
                error: function (xhr, type) {
                    alert('Ajax error!');
                    // 即使加载出错，也得重置
                    me.resetload();
                }
            });
        },
        loadUpFn: function (me) {
            var keyword = $('input[name="id"]').val();
            page = 1;
            $.ajax({
                url: '{:url("First/ajaxactivitypl")}',
                data: 'page=' + page + '&activity_id=' + keyword,
                type: 'POST',
                dataType: 'json',
                success: function (data) {
                    $('.upOrDown_data').empty();//
                    var datas = data.msg;
                    $.each(datas, function (key, v) {
                        var _html = '';
                        _html += '<div class="flex-wrap">';
                        _html += '<div class="user_img"><img src="' + v.user_image + '" alt=""></div>';
                        _html += '<div class="flex-con">';
                        _html += '<div class="user_name">' + v.user_username;
                        if (v.zj_fb == 1) {
                            _html += '<span class="comment_delete zj_fb"  id="' + v.answer_id + '"></span>';
                            _html += '</div>';
                        }
                        <!-- main1_pinglun.png -->
                        _html += '<div class="comment_desc aui-ellipsis-2">' + v.answer_content + '</div>';
                        _html += '<div class="comment_imgs after">';
                        <!-- 评论图片-->
                        $.each(v.img, function (kk, vo) {
                            _html += '<img src="' + vo + '" alt="">';
                        })
                        _html += '</div>';
                        _html += '<div class="comment_txt">';
                        if (v.answer.length > 0) {
                            $.each(v.answer, function (ky, vk) {
                                _html += '<div class="comment_one">' + vk.user_username + '：' + vk.reply_content;
                                if (vk.is_delete == 1) {
                                    _html += '<span class="red_delete clearDe"  id="' + vk.reply_id + '">删除</span>';
                                }
                                _html += '</div>';
                            })
                            if (v.count > 2) {
                                _html += '<div class="comment_three" onclick="fnComment(this)" idd="' + v.answer_id + '" tapmode="acdtive">';
                                _html += '查看全部回复>';
                                _html += '</div>';
                            }
                        }

                        <!--评论的回复结束-->
                        _html += '</div>';
                        _html += '<div class="comment_footer">';
                        _html += '<span class="comment_time">' + v.answer_time + '</span>';
                        <!--点赞数量开始-->
                        _html += '<span class="float_right" onclick="fnZan(this)" dz="' + v.dz + '" idd="' + v.answer_id + '" tapmode="active">';
                        if (v.dz == 1) {
                            _html += '<span class="zan1"></span>';
                        } else {
                            _html += '<span class="zan"></span>';
                        }

                        _html += '<span id="zan_num">' + v.answer_dz + '</span></span>';
                        <!--点赞结束-->
                        <!--评论数量开始-->
                        _html += '<span class="float_right comment_all" onclick="wei_hui(this)" idd="' + v.answer_id + '" tapmode="active">';
                        _html += '<span class="comment_total"></span>' + v.count;
                        _html += '</span>';
                        <!--评论数量结束-->
                        _html += '</div></div> </div>';

                        $(".upOrDown_data").append(_html);
                    });
                    me.resetload();
                    me.unlock();
                    me.noData(false);
                    $('.clearDe').click(function () {
                        var id = $(this).attr('id');
                        $.ajax({
                            url: '{:url("First/delete")}',
                            data: {answer_id: idd, type: 2},
                            type: 'POST',
                            dataType: 'JSON',
                            success: function (data) {
                                if (data.status == 200) {
                                    layer.open({
                                        content: '操作成功'
                                        , skin: 'msg'
                                        , time: 3 //2秒后自动关闭
                                    });
                                    window.location.reload();
                                } else if (data.status == 'E001') {
                                    layer.open({
                                        content: '操作失败'
                                        , skin: 'msg'
                                        , time: 3 //2秒后自动关闭
                                    });
                                    window.location.reload();
                                }
                            }
                        })
                    });
                    $('.zj_fb').click(function () {
                        var id = $(this).attr('id');
                        $.ajax({
                            url: '{:url("First/delete")}',
                            data: {answer_id: idd, type: 1},
                            type: 'POST',
                            dataType: 'JSON',
                            success: function (data) {
                                if (data.status == 200) {
                                    layer.open({
                                        content: '操作成功'
                                        , skin: 'msg'
                                        , time: 3 //2秒后自动关闭
                                    });
                                    window.location.reload();
                                } else if (data.status == 'E001') {
                                    layer.open({
                                        content: '操作失败'
                                        , skin: 'msg'
                                        , time: 3 //2秒后自动关闭
                                    });
                                    window.location.reload();
                                }
                            }
                        })

                    });
                    $('.fnZan').click(function () {
                        var id = $(this).attr('id');
                        $.ajax({
                            url: '{:url("First/dzactivity")}',
                            data: {answer_id: idd, type: 1},
                            type: 'POST',
                            dataType: 'JSON',
                            success: function (data) {
                                if (data.status == 200) {
                                    layer.open({
                                        content: '操作成功'
                                        , skin: 'msg'
                                        , time: 3 //2秒后自动关闭
                                    });
                                    window.location.reload();
                                } else if (data.status == 'E001') {
                                    layer.open({
                                        content: '操作失败'
                                        , skin: 'msg'
                                        , time: 3 //2秒后自动关闭
                                    });
                                    window.location.reload();
                                }
                            }
                        })

                    });


                },
                error: function (xhr, type) {
                    alert('Ajax error!');
                    me.resetload();
                }
            });
        }
    });
</script>
</html>
